package main

import "fmt"

// 自己实现一个构造函数

// student 创建一个student类型的结构体
type student struct {
	name   string
	age    int
	gender string
	hobby  []string
}

func NewStudent(name string, age int, gender string, hobby []string) *student {
	return &student{
		name:   name,
		age:    age,
		gender: gender,
		hobby:  hobby,
	}
}

func main() {
	r := NewStudent("jack", 18, "nan", []string{"篮球", "足球"})
	fmt.Println(r)
}
